package com.zkingsoft.pojo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @class Result.java
 * @author xieguangya
 * @date 2016年7月22日 
 * @description 返回结果封装类
 */
public class Result implements Serializable{
	private static final long serialVersionUID = 1L;

	public static final String STATUS_OK = "ok";
	public static final String STATUS_ERR = "error";
	public static final String STATUS_TRUE = "true";
	public static final String STATUS_FALSE = "false";
	public static final String STATUS_NEW = "new_user";
	public static final String STATUS_OLD = "old_user";
	
	
	public String code;// 状态码，true:成功，false:失败，error：错误,info:日志
	public Map<String, Object> result;
	private String msg;//消息说明

	public Result() {
		result = new HashMap<String, Object>();
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void addList(List<?> list) {
		this.result.put("list", list);
	}

//	public void addPaginationVO(PaginationVO pageVo) {
//		this.result.put("pageVo", pageVo);
//	}

	public void addInfo(String info) {
		this.result.put("info", info);
	}

	public void addObject(Object object) {
		this.result.put("obj", object);
	}

	public void addOther(String key, Object object) {
		this.result.put(key, object);
	}

	public Map<String, Object> getResult() {
		return result;
	}

	public void setResult(Map<String, Object> result) {
		this.result = result;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
	
}
